<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="__PUBLIC__/Css/manager.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="__PUBLIC__/Js/jquery-1.7.2.min.js"></script>
</head>
<body>
<h2>图片上传 <a href="__APP__/SuccessCase/index" id="backBTN" >[取消返回]</a></h2>

<form action="__APP__/SuccessCase/up" method="post" enctype="multipart/form-data">
    <input type="hidden" name="id" value="{$list['id']}">
    <table id="user_Add">
        <tr>
            <th class="tRight" width="120">案例标题</th>
            <td>{$list['casetitle']}</td>
        </tr>
        <tr>
            <th class="tRight">选择上传案例图片</th>
            <td>
                <input type="file" name="file[]"><br>
                <input type="file" name="file[]"><br>
                <input type="file" name="file[]"><br>
                <input type="file" name="file[]"><br>
            </td>
        </tr>
        <tr>
			 <th class="tRight">&nbsp;</th>
            <td>
                <input type="submit" value="上传">
            </td>
        </tr>
    </table>
    <table cellspacing="0" border="0">
        <tr class="title">
            <th>图片</th>
            <th>上传时间</th>
            <th>是否主图</th>
            <th>排序号</th>
            <th>操作</th>
        </tr>
        <volist name="imgList" id="vo">
            <tr>
                <td>
                    <img src="__PUBLIC__//Uploads/successcase/{$vo['caseid']}/s_{$vo['filename']}" alt="图片">
                </td>
                <td>{$vo["createtime"]|date="Y-m-d H:i:s",###}</td>
                <td>
                    <if condition="$vo['mainimg'] eq 1">
                        主图
                        <elseif condition="$vo['mainimg'] eq 0"/>
                        副图
                    </if>
                    </td>
                <td>
                    <input type="text" size="8"  id="sort_{$vo['id']}" value="{$vo['sort']}">
                </td>
                <td>
                    <br>
                    <a href="__APP__/CaseImg/delete/id/{$vo['id']}">删除</a><br>
                    <a href="__APP__/CaseImg/setMainImg/id/{$vo['id']}/caseid/{$list['id']}">设为主图</a><br>
                    <a href="javascript:setSortNumber({$vo['id']})">修改排序</a><br>
                </td>
            </tr>
        </volist>
    </table>
</form>
<script type="text/javascript">
    function setSortNumber(sortid){
        var sortNumber=$("#sort_"+sortid).val();
        var url="__APP__/CaseImg/sortNumber/id/"+sortid+"/sort/"+sortNumber+"/random/"+Math.random();
        window.location.href=url;
    }
</script>
</body>
</html>